<?php

// This file is part of the Carrington Text Theme for WordPress
// http://carringtontheme.com
//
// Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.
// http://crowdfavorite.com
//
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
// **********************************************************************

if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }
if (CFCT_DEBUG) { cfct_banner(__FILE__); }

query_posts( array ( 'category_name' => 'home', 'posts_per_page' => -1 ) );

?>
<div id="campaign">
   <?php the_post(); the_content(); ?>
</div>
<div id="news">
<?php

	/* Get all sticky posts */
	$sticky = get_option( 'sticky_posts' );

	/* Sort the stickies with the newest ones at the top */
	rsort( $sticky );

	/* Get the 3 newest stickies (change 3 for a different number) */
	$sticky = array_slice( $sticky, 0, 4 );

	/* Query sticky posts */
	query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1, 'posts_per_page' => 4 ) );

	if (have_posts()) {
		while (have_posts()) {
			the_post();

		
			$category = get_the_category($post->ID);
			$categoryName = $category[1]->cat_name;
			
			if($categoryName == 'mediacenter')
			{
				$categoryName = $category[0]->cat_name;
			}


			?>
			
			<article class='highlight'>
				<h3><?php echo $categoryName; ?></h3>
				
				<a class='thumb' href='<?php the_permalink(); ?>'>
				 
				<?php 
				$photos = aldenta_get_images_url('full');
				if ($photos) 
				{
					?>
					<img class='thumb' src="<?php echo $photos[0]; ?>"> 
					<?php
				}else{
				?>
					<img src="<? bloginfo('template_url');?>/img/placeholder.jpg"> 
				<?php
				}
				?>
				<?php the_title();?>
				</a>
				<img class='light' src="<? bloginfo('template_url');?>/img/light.png">
			</article>
    		<?php
		
	}
	
}


?>
			    		
    		
</div>
</div>

